export default {
    namespaced: true,
    state:{
        form : {
            ca_title : "",
            ca_ccid : "",
            ca_short_title : "",
            ca_tags       : "",
            ca_order   : "",
            ca_th_image    : "",
            ca_source : "",
            ca_author : "",
            ca_keywords :"",
            ca_abstract : "",
            ca_is_comment : "0",
            ca_browse_num : "",
            ca_content : "",
            ca_is_audit : "0"
        },
        columnData : [],
        customModelData : []
    },
    mutations:{
        updateColumnData(state,data){
            state.columnData = data
        },
        updateFormCcid(state,data){
            state.form.ca_ccid = data.length > 0 ? data[data.length - 1] : data[0];
        },
        clearForm(state){
            state.form = {
                ca_title : "",
                ca_ccid : "",
                ca_short_title : "",
                ca_tags       : "",
                ca_order   : "",
                ca_th_image    : "",
                ca_source : "",
                ca_author : "",
                ca_keywords :"",
                ca_abstract : "",
                ca_is_comment : "",
                ca_browse_num : "",
                ca_content : "",
                ca_is_audit : ""
            }
        },
        updateCustomModelData(state,data){
            state.customModelData = data
        }
    }
  }